// 文章相关的api

import { request } from '@/utils/request'
// 获取频道列表
export function channelsApi() {
  return request({
    url: '/channels',
    method: 'GET',
  })
}

// 提交文章
export function publishApi(article) {
  return request({
    url: '/mp/articles',
    method: 'POST',
    data: article
  })
}

// 更新文章
export function editpublishApi(target, article) {
  return request({
    url: `/mp/articles/${target}`,
    method: 'PUT',
    data: article
  })
}

// 获取文章列表
export function getArticle(params) {
  return request({
    url: '/mp/articles',
    method: "GET",
    params
  })
}


// 删除文章
export function delArticle(target) {
  return request({
    url: `/mp/articles/${target}`,
    method: "DELETE",
  })
}


// 获取文章详情
export function getArticleDetail(target) {
  return request({
    url: `/mp/articles/${target}`,
    method: "get",
  })
}